package server.demo.dto;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 换乘票务购买请求DTO
 */
public class TransferTicketPurchaseRequest {
    
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    
    @NotNull(message = "换乘票务信息不能为空")
    @NotEmpty(message = "换乘票务信息不能为空")
    private List<TransferTicketInfo> transferTickets;

    // 构造函数
    public TransferTicketPurchaseRequest() {}

    public TransferTicketPurchaseRequest(Long userId, List<TransferTicketInfo> transferTickets) {
        this.userId = userId;
        this.transferTickets = transferTickets;
    }

    // Getter 和 Setter
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public List<TransferTicketInfo> getTransferTickets() {
        return transferTickets;
    }

    public void setTransferTickets(List<TransferTicketInfo> transferTickets) {
        this.transferTickets = transferTickets;
    }

    /**
     * 换乘票务信息
     */
    public static class TransferTicketInfo {
        @NotNull(message = "第一段车次ID不能为空")
        private Long firstTrainId;
        
        @NotNull(message = "第一段座位ID不能为空")
        private Long firstSeatId;
        
        @NotNull(message = "第二段车次ID不能为空")
        private Long secondTrainId;
        
        @NotNull(message = "第二段座位ID不能为空")
        private Long secondSeatId;
        
        @NotNull(message = "乘车人姓名不能为空")
        private String passengerName;
        
        @NotNull(message = "乘车人身份证号不能为空")
        private String passengerIdCard;
        
        @NotNull(message = "出发站ID不能为空")
        private Long startStationId;
        
        @NotNull(message = "中转站ID不能为空")
        private Long transferStationId;
        
        @NotNull(message = "到达站ID不能为空")
        private Long endStationId;

        // 构造函数
        public TransferTicketInfo() {}

        // Getter 和 Setter
        public Long getFirstTrainId() {
            return firstTrainId;
        }

        public void setFirstTrainId(Long firstTrainId) {
            this.firstTrainId = firstTrainId;
        }

        public Long getFirstSeatId() {
            return firstSeatId;
        }

        public void setFirstSeatId(Long firstSeatId) {
            this.firstSeatId = firstSeatId;
        }

        public Long getSecondTrainId() {
            return secondTrainId;
        }

        public void setSecondTrainId(Long secondTrainId) {
            this.secondTrainId = secondTrainId;
        }

        public Long getSecondSeatId() {
            return secondSeatId;
        }

        public void setSecondSeatId(Long secondSeatId) {
            this.secondSeatId = secondSeatId;
        }

        public String getPassengerName() {
            return passengerName;
        }

        public void setPassengerName(String passengerName) {
            this.passengerName = passengerName;
        }

        public String getPassengerIdCard() {
            return passengerIdCard;
        }

        public void setPassengerIdCard(String passengerIdCard) {
            this.passengerIdCard = passengerIdCard;
        }

        public Long getStartStationId() {
            return startStationId;
        }

        public void setStartStationId(Long startStationId) {
            this.startStationId = startStationId;
        }

        public Long getTransferStationId() {
            return transferStationId;
        }

        public void setTransferStationId(Long transferStationId) {
            this.transferStationId = transferStationId;
        }

        public Long getEndStationId() {
            return endStationId;
        }

        public void setEndStationId(Long endStationId) {
            this.endStationId = endStationId;
        }
    }
}